package com.fsmv.brainfuck2;

import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.app.Activity;

public class Help extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		TextView help = new TextView(this);
		help.setText("> 	increment the data pointer (to point to the next cell to the right).\n\n< 	decrement the data pointer (to point to the next cell to the left).\n\n+ 	increment (increase by one) the byte at the data pointer.\n\n- 	decrement (decrease by one) the byte at the data pointer.\n\n. 	output a character, the ASCII value of which being the byte at the data pointer.\n\n, 	accept one byte of input, storing its value in the byte at the data pointer.\n\n[ 	if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command*.\n\n] 	if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command*.\n\n\n\n(Alternatively, the ] command may instead be translated as an unconditional jump to the corresponding [ command, or vice versa; programs will behave the same but will run more slowly, due to unnecessary double searching.)\n\n\n\n*[ and ] match as parentheses usually do: each [ matches exactly one ] and vice versa, the [ comes first, and there can be no unmatched [ or ] between the two.");
		help.setVerticalScrollBarEnabled(true);
		help.setMovementMethod(new ScrollingMovementMethod());
		LinearLayout layout = new LinearLayout(this);
		layout.addView(help);
		setContentView(layout);
	}
}
